package flc.ast.adapter;

import android.graphics.Color;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.IconTypeBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;
import stark.common.basic.view.container.StkRecycleView;
import stark.common.bean.StkResBean;

public class IconTabAdapter extends StkProviderMultiAdapter<StkResBean> {

    public IconTabAdapter() {
        addItemProvider(new StkSingleSpanProvider<>(150));
        addItemProvider(new IconTabProvider());
    }


    private class IconTabProvider extends BaseItemProvider<StkResBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_icon_tab;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, StkResBean bean) {
            Glide.with(baseViewHolder.itemView).load(bean.getUrl()).into((ImageView) baseViewHolder.getView(R.id.ivIconTabItemImg));
        }
    }
}
